# coding=utf-8
from lib.Character.Character import Character
from lib.Core.Drops import Drops
from lib.global_game import player


class Enemy(Character):
    def __init__(self, name, profession, race, base, up_base, level, skills, drops):
        super(Enemy, self).__init__(name, profession, race, base, up_base, level, skills)
        self.drops = Drops(drops)

    def dead_action(self):
        super(Enemy, self).dead_action()
        for item in self.drops.get_drops():
            print('掉落：{0}'.format(item.item_id))
            # 玩家获得物品
            player.add_item(item)
